<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>开始赚钱</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body>
<div id="blank" class="header" style="border-bottom:1px solid #D6D6D6;color:#000">
    <div v-back.tapmode class="back"></div>
    <span class="title">开始赚钱</span>
</div>
<div id="app" class="makeprofit" v-cloak>
    <div class="profitdesc">昨天您赚了<span>0元</span>，输给了<span>99%</span>的人，建议您购买超级 会员或店铺。</div>
    <div class="profit-content">
      <div class="buydesc">
        <div>购买友人店服务：</div>
        <div>友人店帮助广大用户创造轻松创业的平台</div>
      </div>
      <div class="level-content" v-for="(level, index) in levles">
      <div class="vipdesc"  v-if="level.type==5" v-myclick="[level.type, buymember]">
        <div>VIP会员</div>
        <div class="sharedesc" >享受分享收益</div>
        <div>{{level.need_pay_total}}元</div>
      </div>
      <div class="vipdesc" v-if="level.type==6" v-myclick="[level.type, buymember]">
        <div>友人店铺</div>
        <div class="sharedesc" >享受分销、加盟店分红、店铺利润</div>
        <div>{{level.need_pay_total}}元</div>
      </div>
    </div>
    </div>
    <div style="padding:20px;font-size:12px;color:#999999">tips：打铁要趁热，赚钱要趁早！</div>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>

var levle,
    wap_url,
    vm;
apiready = function () {
    showProgress();
    setBSImg();

    new Vue({
        el: '#blank'
    });
    wap_url = getPrefs("wap_url");
    param = api.pageParam;
    invite_code = param.invite_code;
    var data = {
        member_id: getPrefs('member_id')
    };
    var callback = function (ret) {
        levles = ret.content;
        initApp();
        api.parseTapmode();
    }
    pinet.post(URL.getAddMemberLevelInfo, data, callback);
    addListeners();
};

function initApp() {
    vm = new Vue({
        el: '#app',
        data: {
            levles: levles,
            imgPath:'../../image/',
        },
        methods: {
          buymember:function(type){
            var attributes = {
                type: type,
                invite_code:invite_code
            };
            openWin('../user/addshop', {type: type});
          }
        }
    });
}
function addListeners() {
    api.addEventListener({
        name: 'viewappear'
    }, function () {
        onPageStart();
    });
    api.addEventListener({
        name: 'viewdisappear'
    }, function () {
        onPageEnd();
    });

    api.addEventListener({
        name: 'keyback'
    }, function () {
        onPageEnd();
        api.closeWin();
    });
}
</script>
</html>
